package cn.xh.huiminpay.message;

import cn.xh.huiminpay.model.OrderExt;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

/**
 * @Auther:Tao
 * @Date: 2022/3/14 18:47
 * @Desc: topic：监听的主题
 *
 * consumerGroup：消费组，相同消费组的消费者共同消费该主题的消息，它们组成一个集群。
 */
@Component
@RocketMQMessageListener(topic = "my-topic-obj",consumerGroup = "demo-consumer-group")
public class ConsumerSimple implements RocketMQListener<OrderExt> {
   /* @Override
    public void onMessage(String s) {
        System.out.println(s);
    }*/
   @Override
    public void onMessage(OrderExt orderExt) {

       System.out.println(orderExt);
    }
}
